package com.zzhua.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class RestConfig {

    @Bean
    @LoadBalanced // 让restTemplate开启负载均衡的功能，所以能通过provider识别到注册中心对应的服务
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
